package com.googlecode.beanfiles;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Provides an exception mechanism to signal that an argument is invalid.
 * 
 * Still to be determined is whether or not an Exception is appropriate for this use-case, or if some kind of ConverterBase needs to be
 * provided for error reporting. The problem lies with the issue that TypeConversion generally lies outside the domain of this library.
 * I.e., a "converter" may already have a superclass.
 */
public class TranslationArgumentException extends IllegalArgumentException {

    protected static Log log() {
        return LogFactory.getLog(TranslationArgumentException.class);
    }

    public TranslationArgumentException() {}

    public TranslationArgumentException(Exception root) {
        super(root);
    }

    public TranslationArgumentException(Exception root, Object value) {
        super(root);
        setValue(value);
    }
    
    public TranslationArgumentException(String message) {
        super(message);
    }
    
    public TranslationArgumentException(String message, Object value) {
        super(message);
        setValue(value);
    }

    public TranslationArgumentException(String message, Exception root) {
        super(message, root);
    }
    
    public TranslationArgumentException(String message, Object value, Exception root) {
        super(message, root);
        setValue(value);
    }

    private Object value;

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    private String propertyName;

    public String getPropertyName() {
        return propertyName;
    }

    public void setPropertyName(String propertyName) {
        this.propertyName = propertyName;
    }

}
